import BMapLoader from '@amap/amap-jsapi-loader';

const mapBase = {
  key: '929f441ef208936580208a8f8bbc6af1',
  output: 'JSON'
};

export const mapKey = {
  key: 'cddf78537fd70b73282bbbf2d0a155ce',
  securityJsCode: '5aa26eacfbd78177a7519d5999be91a2'
};

export async function mapInit() {
  window._AMapSecurityConfig = {
    securityJsCode: mapKey.securityJsCode
  };
  return BMapLoader.load({
    key: mapKey.key,
    version: '2.0',
    plugins: ['AMap.Marker', 'AMap.Polygon']
  });
}

export default mapBase;
